#define _CRT_SECURE_NO_WARNINGS 1

#include "SeqList.h"

void TestSeqList1()
{
	SL ps;
	SeqListInit(&ps);

	int arr1[] = { 1,2,3,4,5,6 };
	int sz1 = sizeof(arr1) / sizeof(arr1[0]);
	int i = 0;
	for (i = 0; i < sz1; ++i)
	{
		SeqListPushBack(&ps, arr1[i]);
	}

	int arr2[] = { 1,2,3,4,5 };
	int sz2 = sizeof(arr2) / sizeof(arr2[0]);
	for (i = 0; i < sz2; ++i)
	{
		SeqListPushFront(&ps, arr2[i]);
	}

	SeqListDestroy(&ps);
}

void TestSeqList2()
{
	SL ps;
	SeqListInit(&ps);

	int arr1[] = { 1,2,3,4,5,6 };
	int sz1 = sizeof(arr1) / sizeof(arr1[0]);
	int i = 0;
	for (i = 0; i < sz1; ++i)
	{
		SeqListPushBack(&ps, arr1[i]);
	}

	SeqListPrint(&ps);

	SeqListPopBack(&ps);
	SeqListPopBack(&ps);
	SeqListPrint(&ps);

	SeqListPopFront(&ps);
	SeqListPopFront(&ps);
	SeqListPrint(&ps);

	SeqListDestroy(&ps);
}

void TestSeqList3()
{
	SL ps;
	SeqListInit(&ps);

	int arr1[] = { 1,2,3,4,5,6 };
	int sz1 = sizeof(arr1) / sizeof(arr1[0]);
	int i = 0;
	for (i = 0; i < sz1; ++i)
	{
		SeqListPushBack(&ps, arr1[i]);
	}

	SeqListPrint(&ps);

	SeqListErase(&ps, 2);
	SeqListPrint(&ps);
	SeqListErase(&ps, 4);
	SeqListPrint(&ps);
	SeqListErase(&ps, 0);
	SeqListPrint(&ps);

	SeqListDestroy(&ps);
}

int main()
{
	//TestSeqList1();
	//TestSeqList2();
	TestSeqList3();
	return 0;
}